Skip to content

[Gtk4] Fix layout problems#3331

Merged
akurtakov merged 1 commit into
eclipse-platform:masterfrom
akurtakov:3330
May 30, 2026
Merged

[Gtk4] Fix layout problems#3331
akurtakov merged 1 commit into
eclipse-platform:masterfrom
akurtakov:3330

Conversation

@akurtakov
Copy link
Copy Markdown
Member

@akurtakov akurtakov commented May 27, 2026

On Gtk 4 gtk_widget_hide() resets the widget's allocation to 0x0. If the SWT widget is no longer in the HIDDEN state but visibility hasn't propagated in GTK 4, leave it visible on the GTK side so its allocation (and the propagated allocations of its children) survive. Otherwise children of a Composite that was made visible right before this setBounds call would be left at size 0x0 and miss Resize events.

Skip the trailing gtk_widget_hide() on GTK4 when the SWT widget is not in the HIDDEN state, so the allocation survives. GTK3 behaviour is unchanged.

Fixes #3330

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Test Results (linux)

   94 files  ±0     94 suites  ±0   14m 14s ⏱️ -21s
4 597 tests ±0  4 373 ✅ ±0  224 💤 ±0  0 ❌ ±0 
3 383 runs  ±0  3 308 ✅ ±0   75 💤 ±0  0 ❌ ±0 

Results for commit c9b37bb. ± Comparison against base commit 1ac0cbf.

♻️ This comment has been updated with latest results.

@akurtakov akurtakov changed the title [Gtk4] Keep allocation after show-allocate hack in Control.setBounds [Gtk4] Fix layout problems May 27, 2026
@akurtakov akurtakov force-pushed the 3330 branch 3 times, most recently from ef7cfc5 to 2c61610 Compare May 28, 2026 09:37
On Gtk 4 gtk_widget_hide() resets the widget's allocation to 0x0. If the
SWT widget is no longer in the HIDDEN state but visibility hasn't
propagated in GTK 4, leave it visible on the GTK side so its allocation
(and the propagated allocations of its children) survive. Otherwise
children of a Composite that was made visible right before this
setBounds call would be left at size 0x0 and miss Resize events.

Skip the trailing gtk_widget_hide() on GTK4 when the SWT widget is not
in the HIDDEN state, so the allocation survives. GTK3 behaviour is
unchanged.

Fixes eclipse-platform#3330
@akurtakov akurtakov merged commit 5005333 into eclipse-platform:master May 30, 2026
20 checks passed
@akurtakov akurtakov deleted the 3330 branch May 30, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[GTK4] Layout not propagated correctly

1 participant